package com.hb.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * @author Buu Huynh
 * @version 1.0
 * @created 30-May-2013 10:09:05 PM
 */
@Entity
public class Comment {

	
	private Long id;

	private String message;

	private User user;

	private Job job;
	
	private List<File> file;

	public Comment() {

	}

	public void finalize() throws Throwable {

	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	public User getUser() {
		return user;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setUser(User newVal) {
		user = newVal;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	public Job getJob() {
		return job;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setJob(Job newVal) {
		this.job = newVal;
	}

	@OneToMany(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
	public List<File> getFile() {
		return file;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void setFile(List<File> newVal) {
		file = newVal;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(length=3000)
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	
}